import Cookies from 'js-cookie'

export function getStorage (TokenKey) {
  return Cookies.get(TokenKey)
}

export function setStorage (TokenKey, token, seconds = null) {
  if (seconds != null) {
    seconds = seconds;
    let expires = new Date(new Date() * 1 + seconds * 1000);
    return Cookies.set(TokenKey, token)
  }
  return Cookies.set(TokenKey, token)
}

export function removeStorage (TokenKey) {
  return Cookies.remove(TokenKey)
}
